package com.base.platform.controller;

import com.base.platform.biz.DataAnalyzeMasterBiz;
import com.base.platform.entity.DataAnalyzeMaster;
import com.base.platform.entity.query.DataQuery;
import com.base.platform.utils.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * (DataAnalyzeMaster)表控制层
 *
 * @author lihuibin
 * @since 2020-12-16 21:59:48
 */
@RestController
@RequestMapping("dataAnalyzeMaster")
public class DataAnalyzeMasterController {
    /**
     * 服务对象
     */
    @Autowired
    private DataAnalyzeMasterBiz dataAnalyzeMasterBiz;

    /**
     * 通过主键查询单条数据
     *
     * @param id 主键
     * @return 单条数据
     */
    @GetMapping("selectOne")
    public ResponseResult selectOne(Integer id) {
        DataAnalyzeMaster dataAnalyzeMaster = this.dataAnalyzeMasterBiz.queryById(id);
        return ResponseResult.success(dataAnalyzeMaster);
    }

    @PostMapping("query/all")
    public ResponseResult selectAllByExp(@RequestBody DataQuery query) {
        return this.dataAnalyzeMasterBiz.queryList(query);
    }


    @PostMapping("insert")
    public ResponseResult insert(@RequestBody DataAnalyzeMaster model) {
        return this.dataAnalyzeMasterBiz.insert(model);
    }

    @PutMapping("update")
    public ResponseResult update(@RequestBody DataAnalyzeMaster form) {
        return this.dataAnalyzeMasterBiz.update(form);
    }

    @DeleteMapping("delete/{id}")
    public ResponseResult delete(@PathVariable("id") Integer id) {
        return this.dataAnalyzeMasterBiz.delete(id);
    }


}